<template>
	<form-frame v-model="visible" title="配置类型" width="560" :type="formType" :loading="btnLoading" @submit="handleSubmitForm()">
		<el-form ref="form" :model="formData" :rules="formRules" label-width="80px" v-loading="loading">
			<el-form-item label="类型名称" prop="deName">
				<el-input v-model="formData.deName"></el-input>
			</el-form-item>
			<el-row>
				<el-col :span="15">
					<el-form-item label="类型值" prop="deValue">
						<el-input v-model="formData.deValue"></el-input>
					</el-form-item>
				</el-col>
				<el-col :span="9">
					<el-form-item label="排序">
						<el-input-number v-model="formData.sort" controls-position="right" :min="1" :max="999" style="width: 100%"></el-input-number>
					</el-form-item>
				</el-col>
			</el-row>
			<el-form-item label="类型描述">
				<el-input type="textarea" :rows="2" placeholder="请输入配置类型描述" v-model="formData.content"></el-input>
			</el-form-item>
		</el-form>
	</form-frame>
</template>

<script>
import formMixins from '@/views/common/formMixins';
import { queryDictDetail, addedDictDetail, updateDictDetail } from '@/api/system/tbSysDictDetail';
export default {
	mixins: [formMixins],
	data() {
		return {
			formName: '配置类型',
			formRules: {
				deName: [{ required: true, message: '请输入配置类型名称', trigger: 'blur' }],
				deValue: [{ required: true, message: '请输入配置类型值', trigger: 'blur' }]
			}
		};
	},
	methods: {
		//获取数据详情
		getDataDetail() {
			this.getFormDetail(queryDictDetail, this.dataId);
		},

		//添加修改请求
		async submitFormRequest() {
			let params = { ...this.formData, dictId: this.dataId };
			this.handleSubmitFunction(params, addedDictDetail, updateDictDetail);
		}
	}
};
</script>

<style scoped></style>
